<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Schedulatore EDF:  File sorgente trunk/KiwiLogger.h</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generato da Doxygen 1.7.1 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Cerca');
--></script>
<div class="navigation" id="top">
  <div class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Pagina&nbsp;Principale</span></a></li>
      <li><a href="annotated.html"><span>Classi</span></a></li>
      <li class="current"><a href="files.html"><span>File</span></a></li>
      <li id="searchli">
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Cerca" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>Elenco&nbsp;dei&nbsp;file</span></a></li>
      <li><a href="globals.html"><span>Membri&nbsp;dei&nbsp;file</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<h1>trunk/KiwiLogger.h</h1>  </div>
</div>
<div class="contents">
<a href="_kiwi_logger_8h.html">Vai alla documentazione di questo file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#pragma once</span>
<a name="l00002"></a>00002 <span class="preprocessor"></span><span class="preprocessor">#include &quot;<a class="code" href="types_8h.html">types.h</a>&quot;</span>
<a name="l00003"></a>00003 <span class="preprocessor">#include &lt;stdarg.h&gt;</span>
<a name="l00004"></a>00004 
<a name="l00008"></a><a class="code" href="class_kiwi_logger.html">00008</a> <span class="keyword">class </span><a class="code" href="class_kiwi_logger.html">KiwiLogger</a>
<a name="l00009"></a>00009 {
<a name="l00010"></a>00010 <span class="keyword">public</span>:
<a name="l00011"></a>00011         <a class="code" href="class_kiwi_logger.html#afc6250d4f60ac159de4c3c488b1538be">KiwiLogger</a>(<span class="keywordtype">void</span>);
<a name="l00012"></a>00012         <a class="code" href="class_kiwi_logger.html#a6d37897b17aea4641242f53ae43baead">~KiwiLogger</a>(<span class="keywordtype">void</span>);
<a name="l00013"></a>00013         
<a name="l00018"></a>00018         <span class="keywordtype">bool</span> <a class="code" href="class_kiwi_logger.html#a3eb37ec72deb0034c78133b35a18745c">createOutput</a>(<span class="keywordtype">char</span>* output_path);
<a name="l00019"></a>00019         
<a name="l00023"></a>00023         <span class="keywordtype">void</span> <a class="code" href="class_kiwi_logger.html#a0f5c240f1478b127af733d0f3acecf77">closeOutput</a>();
<a name="l00024"></a>00024         
<a name="l00031"></a>00031         <span class="keywordtype">void</span> <a class="code" href="class_kiwi_logger.html#af1123083d07d19cb9d45c0e57766534b">logEvent</a>(timespec time, <span class="keywordtype">char</span>* event_type, <span class="keywordtype">int</span> task_id);
<a name="l00032"></a>00032         
<a name="l00037"></a>00037         <span class="keywordtype">void</span> <a class="code" href="class_kiwi_logger.html#a66127a9785ed34bdca80ca934ba6e489">logCommand</a>(<span class="keywordtype">char</span>* message);
<a name="l00038"></a>00038         
<a name="l00043"></a>00043         <span class="keywordtype">void</span> <a class="code" href="class_kiwi_logger.html#a967950bb08f55ef4070e6fcefd4b5ed8">logNewTask</a>(<span class="keywordtype">int</span> task_id);
<a name="l00044"></a>00044 
<a name="l00045"></a>00045 <span class="keyword">private</span>:
<a name="l00046"></a>00046         
<a name="l00051"></a>00051         <span class="keyword">static</span> <span class="keywordtype">void</span>*    <a class="code" href="class_kiwi_logger.html#a3018cc8db840d0ebffa24680b3734187">KeBuffManager</a>(<span class="keywordtype">void</span>* arg);
<a name="l00052"></a>00052 
<a name="l00053"></a>00053 <span class="keyword">private</span>: 
<a name="l00054"></a><a class="code" href="class_kiwi_logger.html#a6da77d02dc2feacb3d232a3d52912593">00054</a>         <a class="code" href="types_8h.html#a290c812454ee753054e4cc4c0e502950" title="coda con priorità di eventi ordinata temporalmente.">KePrQue</a> <a class="code" href="class_kiwi_logger.html#a6da77d02dc2feacb3d232a3d52912593" title="coda con priorità per ottenere un output sempre corretto.">m_keBuffer</a>;                             
<a name="l00055"></a><a class="code" href="class_kiwi_logger.html#a412d11d4a82167e77e5d71e2edf0d357">00055</a>         pthread_t               <a class="code" href="class_kiwi_logger.html#a412d11d4a82167e77e5d71e2edf0d357" title="thread per lo svuotamento periodico del buffer in output.">m_thBuffThread</a>; 
<a name="l00056"></a><a class="code" href="class_kiwi_logger.html#ac3701de191793ed8f7c6640e76b38bea">00056</a>         pthread_cond_t  <a class="code" href="class_kiwi_logger.html#ac3701de191793ed8f7c6640e76b38bea" title="evento/timer per regolare lo svuotamento del buffer.">m_cndBuffTimer</a>; 
<a name="l00057"></a><a class="code" href="class_kiwi_logger.html#a62460029f0de33643958027c82c002c9">00057</a>         pthread_mutex_t <a class="code" href="class_kiwi_logger.html#a62460029f0de33643958027c82c002c9" title="Mutex per impedire l&amp;#39;immissione di messaggi durante lo svuotamento del buffer.">m_mKeBuffMutex</a>; 
<a name="l00058"></a><a class="code" href="class_kiwi_logger.html#ace2adc66e20b4090b751a62dcae249a6">00058</a>         FILE*   <a class="code" href="class_kiwi_logger.html#ace2adc66e20b4090b751a62dcae249a6" title="File handler dell&amp;#39;output per kiwi.">m_flKiwiOutput</a>;                 
<a name="l00059"></a><a class="code" href="class_kiwi_logger.html#a43d95f0eaa6cd19385ef2cbf9a03f100">00059</a>         <span class="keywordtype">bool</span> <a class="code" href="class_kiwi_logger.html#a43d95f0eaa6cd19385ef2cbf9a03f100" title="indica se è possibile inserire o meno messaggi nel buffer.">m_isEnabled</a>;                               
<a name="l00060"></a>00060 };
<a name="l00061"></a>00061 
</pre></div></div>
</div>
<!--- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&nbsp;</span>Tutto</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&nbsp;</span>Classi</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&nbsp;</span>File</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&nbsp;</span>Funzioni</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&nbsp;</span>Variabili</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&nbsp;</span>Ridefinizioni di tipo (typedef)</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&nbsp;</span>Definizioni</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<hr class="footer"/><address class="footer"><small>Generato il Fri Sep 10 2010 15:26:14 per Schedulatore EDF da&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.1 </small></address>
</body>
</html>
